//
//  Cat.m
//  OC1_类和对象课后作业
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Cat.h"

@implementation Cat

-(id)init
{
    
    _name = @"小白";
    _color = @"gray";
    [self info];
    return self;
    
}

-(void)info
{
    
    NSLog(@"%@ %@", _name, _color);
    
}

-(void)jump
{
    
    NSLog(@"%@色的%@正在跳楼", _color, _name);
    
}


-(id)initWithName:(NSString *)name color:(NSString *)color
{
    
    _name = name;
    _color = color;
    return self;
}

-(NSString *)name
{
    return _name;
}

-(void)setName:(NSString *)name
{
    _name = name;
}
-(NSString *)color
{
    return _color;
}
-(void)setColor:(NSString *)color
{
    _color = color;
}


+ (id)catWithName:(NSString *)name color:(NSString *)color
{
    Cat *c = [[Cat alloc] initWithName:name color:color];
    return c;
}





@end
